Draw
'Draw ' is a premium Touch Lua library introduced in the 1.1 update that costs $4.99 to unlock. It allows users to draw on a special drawing panel called the "Graphics screen". It also allows use of the gyroscope and allows tracking the touch screen. Library functions | numbers width, height|Returns the fixed size of the screen.|Touch Lua 1.1}} | numbers width, height|Returns the size of the current screen orientation.|Touch Lua 1.1}} |Changes the graphics screen title to the string given.|Touch Lua 1.1}} | |Starts a drawing buffer. All drawing functions called after draw.beginframe has been called will only be drawn to the screen after draw.endframe has been called.|Touch Lua 1.1}} | |All drawing functions called after draw.beginframe has been called will drawn to the screen at once. Allows graphical applications to run faster.|Touch Lua 1.1}} |Clears the Graphics screen, using the color white or the color given.|Touch Lua 1.1}} |Moves the current point on the Graphics screen to the coordinates x, y.|Touch Lua 1.1}} |Draws a point onto the Graphics screen.|Touch Lua 1.1}} |Draws a line onto the Graphics screen.|Touch Lua 1.1}} |Draws a line from the current point to the given coordinates onto the Graphics screen.|Touch Lua 1.1}} |Draws a string onto the Graphics screen.|Touch Lua 1.1}} |Draws a string completely inside a rectangle on the Graphics screen.|Touch Lua 1.1.1}} |Draws a rectangle outline on the Graphics screen.|Touch Lua 1.1}} |boolean flag|Returns the set anti-alias.|Touch Lua 1.1}} | |Enables automatic refreshing of the screen.|Touch Lua 1.1}} | |disables automatic refreshing of the screen.|Touch Lua 1.1}} |numbers xpos, ypos|Waits until user taps on the screen and returns the position on the screen that the user tapped on. Useful for menus.|Touch Lua 1.1}} |nil|Does the touch events set with draw.tracktouches.|Touch Lua 1.1.3}} | |Resets the touch events set with draw.tracktouches.|Touch Lua 1.1.3}} | |Resets the draw clipping, restoring the ability to draw anywhere on the screen without getting cut off.|Touch Lua 1.3.1}} |Draw an image to the screen. The image drawn is scaled and rotated according to the variables given.|Touch Lua 1.3.1}} |Sets the transparent color used for backgrounds, and also clears the screen with the color. It is used for transparent backgrounds when creating images.|Touch Lua 1.3.1}} | |This function clears the screen to be transparent. The transparent color will be used to represent transparent backgrounds when creating images.|Touch Lua 1.3.1}} |This function sets a region of the screen to be the transparent color. The transparent color will be used to represent transparent backgrounds when creating images.|Touch Lua 1.3.1}} }} Colors The draw library also includes fourteen default colors for use with the draw library functions. The same colors and color system is included with the Turtle library. List of colors and their RGB values All of these colors have full alpha values. *draw.cyan (0, 255, 255) *draw.purple (127, 0, 127) *draw.lightgray (170, 170, 170) *draw.orange (255, 127, 0) *draw.white (255, 255, 255) *draw.magenta (255, 0, 255) *draw.green (0, 255, 0) *draw.gray (127, 127, 127) *draw.red (255, 0, 0) *draw.darkgray (85, 85, 85) *draw.brown (153, 102, 51) *draw.yellow (255, 255, 0) *draw.blue (0, 0, 255) *draw.black (0, 0, 0) Category:Draw library Category:Lua libraries Category:Touch Lua libraries